<me:UIGPDAT x:Class="WPFExcelReport.TGB04"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
                    xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT"  
                    xmlns:GS="clr-namespace:WPFExcelReport;assembly=TGSDAT"  
                    xmlns:GC="clr-namespace:WPFExcelReport;assembly=TGSCOLOR"  
                    xmlns:WH="clr-namespace:WPFExcelReport;assembly=TLAGPL"  
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"                   
                    x:Name="TV"
                    Loaded="Window_Loaded"
     >
    <me:UIGPDAT.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>       <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:NOTConverter  x:Key="not"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:Divideby100 x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
    </me:UIGPDAT.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
        </Grid.RowDefinitions>
        <StackPanel>
            <WrapPanel>
                <Button   Click="NewCommand" Height="24" Margin="5,0,0,0" Width="20" >
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/Add.png" />
                    </Button.Background>
                </Button>
                <Button Click="DeleteCommand" Height="24" Margin="5,0,0,0" Width="20" >
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/Remove.png" />
                    </Button.Background>
                </Button>
                <Button   Click="EditCommand" Height="24" Margin="5,0,0,0" Width="20" >
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/Edit.png" />
                    </Button.Background>
                </Button>
                <Button   Click="SaveCommand" Height="24" Margin="5,0,0,0" Width="20" 
                          Visibility="{Binding IsEdit,Converter={StaticResource bv}}" >
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/Save.png" />
                    </Button.Background>
                </Button> 
            </WrapPanel>
            <WrapPanel>
                <Grid    Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=纱线规格:}}"></TextBlock>
                    <TextBlock   Grid.Column="1"  Text="{Binding GPGART, Source={StaticResource vwMaster}, Converter={StaticResource gb2312}}" Width="100" />
                </Grid>
                <Grid Visibility="Collapsed"  Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=色号:}}"></TextBlock>
                    <TextBlock   Grid.Column="1"   Text="{Binding GPGFARBE, Source={StaticResource vwMaster}, Converter={StaticResource gb2312}}" Width="100" />
                </Grid>
                <Grid Visibility="Collapsed"  Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=批次:}}"></TextBlock>
                    <ex:TXT72  Grid.Column="1"  Text="{Binding GPPARTIE}" Width="60" 
                               MaxLength="10" CharacterCasing="Upper"
                               IsReadOnly="{Binding IsEdit,Converter={StaticResource not}}" />
                </Grid>
                <Grid  Visibility="Collapsed"  Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=纺批:}}"></TextBlock>
                    <ex:TXT72  Grid.Column="1"  Text="{Binding GPSPPART, Converter={StaticResource gb2312}}" Width="60" 
                               MaxLength="10" CharacterCasing="Upper"
                               IsReadOnly="{Binding IsEdit,Converter={StaticResource not}}" />
                </Grid>
                <Grid Visibility="Collapsed" Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=染批:}}"></TextBlock>
                    <ex:TXT72 Grid.Column="1"   Text="{Binding GPFBPART, Converter={StaticResource gb2312}}" Width="60" 
                               MaxLength="10" CharacterCasing="Upper"
                               IsReadOnly="{Binding IsEdit,Converter={StaticResource not}}" />
                </Grid>
                <Grid Visibility="Collapsed"  Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=捻批:}}"></TextBlock>
                    <ex:TXT72 Grid.Column="1"  Text="{Binding GPZWPART, Source={StaticResource vwMaster}, Converter={StaticResource gb2312}}" Width="60" 
                               MaxLength="10" CharacterCasing="Upper"
                               IsReadOnly="{Binding IsEdit,Converter={StaticResource not}}" />
                </Grid>
            </WrapPanel>
            <WrapPanel Visibility="{Binding IsNew,Converter={StaticResource bv}}">
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>

                    </Grid.ColumnDefinitions>
                    <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=库位:}}"></TextBlock>
                    <CheckBox  Grid.Column="1" Name="cWH"></CheckBox>
                    <WrapPanel  Grid.Column="2" >
                        <ex:TXT72  MaxLength="2" CharacterCasing="Upper"  Text="{Binding LO, ElementName=TV}" Width="40"/>
                        <ex:TXT72  MaxLength="2" CharacterCasing="Upper"  Text="{Binding LB, ElementName=TV}" Width="60"/>
                        <ex:TXT72  MaxLength="8" CharacterCasing="Upper"  Text="{Binding LP, ElementName=TV}" Width="60"/>
                        <WH:TSWH  KEY="{Binding WH,ElementName=TV}"
                                      Visibility="{Binding IsChecked,ElementName=cWH,Converter={StaticResource bv}}"/>
                    </WrapPanel>
                </Grid>
                <GC:TSGS07 IsEdit="True"
                           KEY="{Binding ART,ElementName=TV}"
                    />
                <SD:K0015 IsEdit="True"
                          LMS=""
                          KEY="{Binding MU,ElementName=TV}"
                          />
                <TextBlock   Text="{Binding Source={Localization:Translate Word=箱数:}}"   FontSize="18"></TextBlock>
                <ex:NumericBox DecimalPlaces="0"   Text="{Binding BOX,ElementName=TV}" FontSize="18"  Width="40" ></ex:NumericBox>
                <TextBlock   Text="{Binding Source={Localization:Translate Word=总重量KG:}}"   FontSize="18"></TextBlock>
                <ex:NumericBox DecimalPlaces="2"   Text="{Binding QTY,ElementName=TV,Converter={StaticResource d100}}" FontSize="18"  
                               KeyUp="QTY_KeyUp"
                               Width="120" />

                <Button   Click="NewCommand" Height="24" Margin="5,0,0,0" Width="20" >
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/button_ok.png" />
                    </Button.Background>
                </Button>
            </WrapPanel>
        </StackPanel>
    </Grid>
</me:UIGPDAT>
